22/5/2020

Introduction

This is an R Markdown presentation showing some graphs generated with plotly for the third week assignment of the Developing Data Products course, part of the DataScience Specialization. We’ve used the diamonds dataset as source of information

Barplots (1/2)

Cut vs. carats barplot

plot_ly(diamonds,x=~cut,y=~carat,mode="markers",color=~cut,width=800,height = 400)

Barplots (2/2)

Cut vs. price barplot split by color

plot_ly(diamonds,x=~cut,y=~price,mode="markers",color=diamonds$color,width=800,height = 400)

Scatterplots (1/2)

Caret vs. price barplot split by color

plot_ly(diamonds,x=~carat,y=~price,mode="markers",color=diamonds$color,size=diamonds$depth,width=800,height = 400)

Scatterplots (2/2)

plot_ly(diamonds,x=~carat,y=~price,mode="markers",color=~cut,width=800,height = 400)

Histograms (1/2)

Price histogram

plot_ly(x = ~diamonds$price, type = "histogram",width=800,height = 400)

Histograms (2/2)

Carat histogram

plot_ly(x = ~diamonds$carat, type = "histogram",width=800,height = 400)

Boxplots (1/2)

Cut vs. carats barplot

plot_ly(diamonds, y = ~carat, color = ~diamonds$cut, type = "box",width=800,height = 400)

Boxplots (2/2)

Color vs. carat boxplot

plot_ly(diamonds, y = ~carat, color = ~diamonds$color, type = "box",width=800,height = 400)

Heatmap

Carat vs. price heatmap

data <- matrix(diamonds$carat,diamonds$price)
plot_ly(z = ~data, type = "heatmap",width=800,height = 400)

3D plot

Carat vs. price heatmap

plot_ly(x = diamonds$x, y = diamonds$y, z = diamonds$z,type = "scatter3d", color = diamonds$cut,width=800,height = 400)